using FreeSql.DataAnnotations;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace ProjectManageSystemApi.DbEntity
{

	/// <summary>
	/// 项目表
	/// </summary>
	[JsonObject(MemberSerialization.OptIn), Table(Name = "item_info", DisableSyncStructure = true)]
	public partial class ItemInfo {

		[JsonProperty, Column(Name = "id", IsPrimary = true, IsIdentity = true)]
		public int Id { get; set; }

		/// <summary>
		/// 工程Id
		/// </summary>
		[JsonProperty, Column(Name = "project_id")]
		public int ProjectId { get; set; }

		/// <summary>
		/// 项目编号
		/// </summary>
		[JsonProperty, Column(Name = "item_no", StringLength = 100)]
		public string ItemNo { get; set; }

		/// <summary>
		/// 项目名称(砖,水泥,沙等)
		/// </summary>
		[JsonProperty, Column(Name = "item_name", StringLength = 100)]
		public string ItemName { get; set; }

		/// <summary>
		/// 备注描述
		/// </summary>
		[JsonProperty, Column(Name = "item_desc", StringLength = 200)]
		public string ItemDesc { get; set; }

		/// <summary>
		/// 预算用量
		/// </summary>
		[JsonProperty, Column(Name = "budget_dosage", DbType = "double(8,2)")]
		public double? BudgetDosage { get; set; }

		/// <summary>
		/// 预算总金额
		/// </summary>
		[JsonProperty, Column(Name = "budget_amount", DbType = "decimal(8,2)")]
		public decimal? BudgetAmount { get; set; }

		/// <summary>
		/// 实际用量
		/// </summary>
		[JsonProperty, Column(Name = "fact_dosage", DbType = "double(8,2)")]
		public double? FactDosage { get; set; }

		/// <summary>
		/// 实际总金额
		/// </summary>
		[JsonProperty, Column(Name = "fact_amount", DbType = "decimal(8,2)")]
		public decimal? FactAmount { get; set; }

		/// <summary>
		/// 用量单位
		/// </summary>
		[JsonProperty, Column(Name = "unit", StringLength = 10)]
		public string Unit { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[JsonProperty, Column(Name = "create_time")]
		public long CreateTime { get; set; }

		/// <summary>
		/// 创建用户
		/// </summary>
		[JsonProperty, Column(Name = "create_user", StringLength = 20)]
		public long CreateUser { get; set; }

		/// <summary>
		/// 修改用户
		/// </summary>
		[JsonProperty, Column(Name = "modify_user")]
		public long ModifyUser { get; set; }

		/// <summary>
		/// 修改时间
		/// </summary>
		[JsonProperty, Column(Name = "modify_time")]
		public long ModifyTime { get; set; }

		/// <summary>
		/// 状态(默认0)
		/// </summary>
		[JsonProperty, Column(Name = "state", DbType = "tinyint(4)")]
		public sbyte State { get; set; }

		[Navigate(nameof(ItemImageInfo.ItemId))]
		public List<ItemImageInfo> ItemImageInfos { get; set; } = new List<ItemImageInfo>();

		[Navigate(nameof(CostInfo.ItemId))]
		public List<CostInfo> CostInfos { get; set; } = new List<CostInfo>();
	}

}
